package ru.spb.osll.myfit.common;

import ru.spb.osll.myfit.client.service.PageExecutingService;
import ru.spb.osll.myfit.server.FitServiceImpl;
import ru.spb.osll.myfit.server.execute.PageExecutingServiceImpl;

public class GlobalContainer {
	private static GlobalContainer m_instance = null;
	private FitServiceImpl m_fitService = null;
	private PageExecutingService m_pageExecutingService = null;
	private Page m_testResult = null;
	
	private GlobalContainer() {
		m_fitService = new FitServiceImpl();
		m_pageExecutingService = new PageExecutingServiceImpl();
	}
	
	public static GlobalContainer instance() {
		if(m_instance == null) {
			m_instance = new GlobalContainer();
		}
		
		return m_instance;
	}
	
	public FitServiceImpl getFitService() {
		return m_fitService;
	}
	
	public PageExecutingService getPageExecutingService(){
	  return m_pageExecutingService;
	}
	
	public Page getTestResult() {
		return m_testResult;
	}
	
	public void setTestResult(Page testResult) {
		m_testResult = testResult;
	}
}
